package org.mayanjun.code.easyweb.springmvc.interceptor;

import org.mayanjun.code.easyweb.springmvc.config.Global;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author mayanjun
 * @since 0.0.2(Jan 15, 2016)
 */
public class PerceiveDeviceInterceptor extends AnnotationBasedHandlerInterceptor {

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
		request.setAttribute(Global.REQUEST_ATTR_PERCEIVE_DEVICE_KEY, Boolean.TRUE);
		return true;
	}

	@Override
	public int getOrder() {
		return Integer.MIN_VALUE;
	}
}
